package com.itheima.test5;

public class PhoneTest {
    public static void main(String[] args) {
        Phone[] phones = new Phone[3];
        phones[0] = new Phone("小米", "蓝色", 100);
        phones[1] = new Phone("苹果", "金色", 10000);
        phones[2] = new Phone("华为", "黑色", 120);
        int sum = 0;
        for (int i = 0; i < phones.length; i++) {
            sum += phones[i].getPrice();
        }
        double avg = sum * 1.0 / phones.length;

        System.out.println(avg);
    }
}
